isOnline
(5 actions, 4 KB)
0 Comment
π Original by: [@atnbueno](https://www.reddit.com/user/atnbueno)
1 TextγΒ»
if (navigator.onLine) { r = new XMLHttpRequest() r.open('GET', 'https://dummyjson.com/test', false) } try { r.send(null) isOnline = 'true' } catch (e) { isOnline = 'false' } document.write(isOnline)
2 Run Shortcut
Run JavaScript Code
γΒ»
4
Input
:
[1 Text]
Workflow
:
{ "workflowIdentifier": "E2CEB2A0-A1D2-4040-B3D2-804B9C84CAE8", "workflowName": "Run JavaScript Code", "isSelf": false }
3 Comment
Alternative approach: simply use the "Get Current IP Address" action
4 Stop and Output
[2 Shortcut Result
as Boolean
]